package client

import (
	"context"
	"gitee.com/tietang/terrace-go/v2/example/apis"
	log "github.com/sirupsen/logrus"
	"net/rpc"
)

//Account应用层服务，提供业务用例
type AccountServiceClient struct {
	Client *rpc.Client
	//Client *jsonrpc.Client
}

func (c *AccountServiceClient) OpenAccount(ctx context.Context, creator apis.AccountCreateDTO) (rv *apis.AccountDTO, err error) {
	err = c.Client.Call("Account.OpenAccount", creator, rv)
	if err != nil {
		log.Fatal("arith error:", err)
		return nil, err
	}
	return rv, err
}
